<%@ page language="java"  pageEncoding="utf-8"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Insert title here</title>
<jsp:include page="/public/public.jsp"/>
</head>
<body>
<jsp:include page="/public/head.jsp"/>  
    <div class="wrapper clearfix">
    <jsp:include page="/public/left.jsp"/>  
	<div class="main">
<s:form name="roleMAction" action="roleMAction!saveMenus.action" namespace="/role">
<input type="text" value="${roleId }" name="roleId"/>
<table class="advert-tab" cellspacing="0">
<tr class="advert-th">
		<th style="text-align:right;"><input type="submit" value="提交"/>&nbsp;<input type="button" value="返回" onclick="history.back();"/></th>
	</tr>
	<tr>
		<td colspan=3>
		<table class="advert-tab" cellspacing="0">
			<tr class="advert-th">
				<th width="20%">一级菜单</th>
				<th width="40%">二级菜单</th>
				<th width="40%">三级菜单</th>
				</tr>
		</table>
		</td>
	</tr>
	<tr>
		<td style="text-align:left;">
		
	<s:iterator  value="#request.menulist" id="menu" status="menulist">
	<s:if test="#menu.parent==0">
	
	
	 <s:set name="mid" value="#menu.menuId" />
		<table  cellspacing="0">
		<tr  >
			<td width="20%" style="text-align:left;">
			
			&nbsp;&nbsp;<input type="checkbox" name="menuIds" id="chk_<s:property value="#menu.menuId" />" 
			
			<s:iterator  value="#request.rmenuList" id="mnud" status="mnuds">
					<s:if test="#mnud.menuId==#mid">
						checked
					</s:if>
			</s:iterator>
			value="<s:property value="#menu.menuId" />"/>
			<s:property value="#menu.menuName" />
			</td>
			<td width="40%" style="text-align:left;">
				<s:iterator  value="#request.menulist" id="menu2" status="menulist1">
				 <s:set name="mid1" value="#menu2.menuId" />
					<s:if test="#mid==#menu2.parent">
						&nbsp;&nbsp;<input type="checkbox" name="menuIds" 
						<s:iterator  value="#request.rmenuList" id="mnud2" status="mnud2">
							<s:if test="#mnud2.menuId==#mid1">
								checked
							</s:if>
						</s:iterator>
						id="chk_<s:property value="#menu2.menuId" />" value="<s:property value="#menu2.menuId" />"/>
						<s:property value="#menu2.menuName" />
					</s:if> 
				</s:iterator>
			</td>
			<td width="40%" style="text-align:left;">
					<s:iterator  value="#request.menulist" id="menu1" status="menulist1">
						<s:if test="#mid==#menu1.parent">
							<s:set name="parent2" value="#menu1.menuId" />
								<s:iterator  value="#request.menulist" id="menu3" status="menulist3">
									<s:set name="mid3" value="#menu3.menuId" />
									<s:if test="#parent2==#menu3.parent">
										&nbsp;&nbsp;
										<input type="checkbox" 
										<s:iterator  value="#request.rmenuList" id="mnud3" status="mnud3">
											<s:if test="#mnud3.menuId==#mid3">
												checked
											</s:if>
										</s:iterator>
										name="menuIds" id="chk_<s:property value="#menu3.menuId" />" value="<s:property value="#menu3.menuId" />"/><s:property value="#menu1.menuName" />
										→&nbsp;
										<s:property value="#menu3.menuName" />
									</s:if>
								</s:iterator>
						</s:if>
					</s:iterator>&nbsp;
			</td>
		</tr>
		</table>
		</s:if>
	</s:iterator>
	</td></tr></table>
</s:form>
</div>
</div>
<%@ include file="/public/footer.jsp"%>
</body>
</html>